package leetcode.easy;

import java.util.Arrays;

/**
 * ClassName: $455_disCookie
 * Description: lc445-分发饼干
 * date: 2021-09-30 9:57
 *
 * @author liyifan
 */
public class $455_disCookie {
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int i = 0;
        int j = 0;
        while (i < g.length && j < s.length) {
            if (s[j] >= g[i]) {
                i++;
            }
            j++;

        }
        return i;
    }
}
